<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\helpers\Url;

?>

<!DOCTYPE html>
<html>
<head>
  <title></title>
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" />
  <meta name="apple-mobile-web-app-capable" content="yes" />
  <meta name="apple-mobile-web-app-status-bar-style" content="black" />
  <meta name="format-detection" content="telephone=no" />
  <link href="/css/style.css" rel="stylesheet">
  <script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
  <script src="/js/mobiscroll.custom.min.js"></script>
    <link href="/css/mobiscroll.custom.min.css" rel="stylesheet" type="text/css" />
</head>
<body>

    <div class="registration-form">
         
        <div class="registration-form">
         
         
        <?php $form = ActiveForm::begin(['id'=>'form111']); ?>


        
           <div  id="traffic" class="view">
    <div class="wapper2 wapper" >
        <img class="jt" src="/img/jt.png" style="width: 200px;position: absolute;left: 50%;margin-left: -100px;margin-top: -18px;">
        <img src="/img/n1.png">
	<ul>
        <li>
            <span>Departure</span>
        </li>
		<li>
            <span>Transportation tool</span><br>
            <input type="radio" name="Registration[come_transportation]" value="飞机" <?= $model->come_transportation=='飞机'?'checked':''?>> <span>Airplane</span>
            <input type="radio" name="Registration[come_transportation]" value="火车" <?= $model->come_transportation=='火车'?'checked':''?>> <span>Train</span>
            <input type="radio" name="Registration[come_transportation]" value="自驾" <?= $model->come_transportation=='自驾'?'checked':''?>> <span>Self drive</span>
		</li>
	
		<li id='std1'>
                <span>Departure city</span>
                <input type="text" id="departure_city"   name="Registration[departure_city]" value="<?= $model->departure_city?>">
            
		</li>
	
		<li id='std2'>
                <span>Arrival location</span>
                <select id="registration-arrival_location" name="Registration[arrival_location]" aria-invalid="false">
							<option value="上海浦东国际机场T2航站楼" <?= $model->arrival_location=='上海浦东国际机场T2航站楼'?'selected':''?>>Terminal 2, Shanghai Pudong International Airport</option>
							<option value="上海浦东国际机场T1航站楼" <?= $model->arrival_location=='上海浦东国际机场T1航站楼'?'selected':''?>>Terminal 1, Shanghai Pudong International Airport</option>
							<option value="南京禄口国际机场T2航站楼" <?= $model->arrival_location=='南京禄口国际机场T2航站楼'?'selected':''?>>Terminal 2, Nanjing Lukou International Airport</option>
							<option value="南京路口浦东国际机场T1航站楼" <?= $model->arrival_location=='南京禄口国际机场T1航站楼'?'selected':''?>>Terminal 1, Nanjing Lukou International Airport</option>
							<option value="南京站" <?= $model->arrival_location=='南京站'?'selected':''?>>Nanjing Station</option>
							<option value="南京南站" <?= $model->arrival_location=='南京南站'?'selected':''?>>Nanjing South Railway Station</option>
		       </select>
                 
					
		</li>
	
		<li id='std3'>
                <span>Departure flight/train</span>
					<input type="text" id="come_flight_number"   name="Registration[come_flight_number]" value="<?= $model->come_flight_number?>">
		</li>
		<li>

                <span>Flight/train arrival time</span>
				
					
				<input type="text" id="demo_datetime" name="Registration[arrival_time]"  readonly="readonly" value="<?= $model->arrival_time?>" style="width:60%;"/>
			
		</li>
		
		<li id='std5'>
                <span>Pickup or not</span>
                <input type="hidden" name="Registration[is_aircraft]" value="">
                    <input type="radio" name="Registration[is_aircraft]" style='padding-left:10px' value="是" <?= $model->is_aircraft=='是'?'checked':''?>> <span>Yes</span>
                    <input type="radio" name="Registration[is_aircraft]" style='padding-left:10px' value="否" <?= $model->is_aircraft=='否'?'checked':''?>> <span>No</span>
		</li>
	
	</ul>
</div>
</div>
     <!-- 
       <a href="Url::to(['summit/vip','code']=>$model->invitation_code)">
       <input id="pre" style="" value="" type="button">
       </a>-->
       <input id="pre" style="" value="" type="button" onClick="test()">
        <input id="next" style="" value="" type="button">




 <?php ActiveForm::end(); ?>
       <input type="hidden" value="<?=$model->invitation_code?>" id='code-index'>   
        
    </div>
         
          
        
    </div>

</body>
</html>
<script>
function getCookie(name)
{
var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)");
if(arr=document.cookie.match(reg))
return unescape(arr[2]);
else
return null;
}
function test(){
    window.location.href=getCookie('url');
}
$(function(){

var theme= "bootstrap";
        var mode = "scroller";
        var display = "bottom";
        var lang="zh";
 $('#demo_datetime').mobiscroll().datetime({
            theme: theme,
            mode: mode,
            display: display,
            lang: lang,
            dateFormat:"mm-dd",
            minDate: new Date(2018,4,9,0,0),
            maxDate: new Date(2018,4,11,23,59),
            stepMinute: 1
        });

$('#next').click(function(){
	var tans=$("input[name='Registration[come_transportation]']:checked").val();
	if(tans=='自驾'){
		
		
	}else{
	var departure_city=$('#departure_city').val();if(departure_city==''){alert('Please fill in your departure city');return false;}
	var arrival_location=$('#arrival_location').val();if(arrival_location==''){alert('Please fill in your arrival location');return false;}
	var come_flight_number=$('#come_flight_number').val();if(come_flight_number==''){alert('Please fill in your flight number/train number');return false;}
	var arrival_time=$('#arrival_time').val();if(arrival_time==''){alert('Please fill in your arrival time');return false;}
	}
	
	$('#form111').submit();
	
	
})
});
</script>